<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<title>隐患追踪管理</title>
		<style type="text/css">
.ui-datatable-scrollable-header-box {
	margin-left: 0px;
	margin-right: 15px !important;
}

.ui-datalist-empty-message {
	min-height: 100px;
}

.ui-datalist-content {
	min-height: 100px;
}

.editForm:faultTime_input {
	width: 100px;
	!
	important;
}

#addFaultReportForm .ui-calendar>.ui-state-default {
	border: 0px;
}

.ui-button-icon-only .ui-button-text {
	padding: .3em;
	text-indent: -9999999px;
	height: 27px;
}

/**如果datable使用了：resizableColumns ="true"，需要增加以下样式**/
.ui-datatable-resizable {
	overflow: visible !important;
}
</style>
<script>
	function openHiddenTrackDetail(trackId,changeStatus) {
		MyModal.showModal("/ui/equipmentAssessment/assessmenthiddendanger/dialog/hiddenDangerTrackDetailDialog.xhtml?changeStatus="+changeStatus +"&amp;trackId="+trackId);
	}
	
	function dialogReturn(index){
			onDialogReturn();
		  }
	
	
	
</script>

	</ui:define>
	<ui:define name="content">
		<div id="headDiv" class="box box-solid with-border">
			<h:form id="headForm">
				<p:confirmDialog global="true" showEffect="fade" hideEffect="fade"  >
					<p:commandButton value="是" type="button"
						styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
					<p:commandButton value="否" type="button"
						styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
				</p:confirmDialog>
				<div class="box-header" id="queryDiv">
					<p:autoComplete id="stationSearch" dropdown="true"
						placeholder="变电站首字母查询" scrollHeight="400"
						value="#{hiddenDangerTrackController.queryParam.substation}"
						style="margin-right:10px"
						completeMethod="#{hiddenDangerTrackController.completeStation}">
					</p:autoComplete>
					<p:autoComplete id="planSearch" dropdown="true"
						placeholder="计划查询" scrollHeight="400"
						value="#{hiddenDangerTrackController.queryParam.planName}"
						style="margin-right:10px"
						completeMethod="#{hiddenDangerTrackController.completePlan}">
					</p:autoComplete>
					<p:outputLabel value="是否完成：" />
					<h:selectOneMenu id="isFinish"
						value="#{hiddenDangerTrackController.queryParam.isFinished}"
						style="width:80px;margin-right:10px;height:30px">
						<f:selectItem itemLabel="全部" itemValue="" />
						<f:selectItem itemLabel="完成" itemValue="1" />
						<f:selectItem itemLabel="未完成" itemValue="0" />
					</h:selectOneMenu>
					<p:outputLabel for="popup7" value="完成时间：" />
					<p:calendar id="popup7" navigator="true"
						value="#{hiddenDangerTrackController.queryParam.queryDateStart}"
						pattern="yyyy-MM-dd" maxdate="Date()" size="12">
					</p:calendar>
					<p:outputLabel for="popup8" value="至 "
						style="margin-right:5px;margin-left:5px;" />
					<p:calendar id="popup8" navigator="true"
						value="#{hiddenDangerTrackController.queryParam.queryDateEnd}"
						pattern="yyyy-MM-dd" maxdate="Date()" size="12">
					</p:calendar>
					<p:commandButton value="查询" id="query2"
						update="form:dataTb headForm:toolbar" icon="ui-icon-search"
						actionListener="#{hiddenDangerTrackController.query}"
						style="margin-left:10px;">
					</p:commandButton>
					<p:commandButton icon="ui-icon-refresh" value="重置"
						actionListener="#{hiddenDangerTrackController.resetQuery}"
						style="margin-left:5px;"
						update=" stationSearch isFinish voltageLevel popup7 popup8 headForm:toolbar form:dataTb  expert  planSearch" />
					<div class="box-tools pull-right">
						<button type="button" id="selectButton" title="高级查询"
							class="btn btn-default" onclick="onSelectDivClick();"
							style="margin-right: 50px;">
							<span id="selectButtonIcon" class="fa fa-caret-down">高级查询</span>
						</button>
					</div>
				</div>
				<div class="panel-collapse collapse" id="selectDiv">
					<p:outputLabel value="电压等级：" style="margin-left:10px;" />
					<h:selectOneMenu id="voltageLevel"
						value="#{hiddenDangerTrackController.queryParam.voltage}"
						style="width:120px;height:30px">
						<f:selectItem itemLabel="全部" itemValue="" />
						<f:selectItem itemLabel="500kV及以上" itemValue="499" />
						<f:selectItem itemLabel="220kV及以下" itemValue="221" />
					</h:selectOneMenu>
					<p:outputLabel value="检查专家：" style="margin-left:10px;" />
					<p:autoComplete  id="expert" dropdown="true" placeholder="输入专家首字母查询" scrollHeight="400"
						value="#{hiddenDangerTrackController.queryParam.expertName}" style="margin-right:20px;"
					   completeMethod="#{hiddenDangerTrackController.completeExpert}"	>								  
					</p:autoComplete>
				</div>
				<div id="toolbarDiv">
					<p:toolbar id="toolbar">
						<f:facet name="left">
							<p:commandButton value="编辑" icon="ui-icon-pencil"  
								rendered="#{s:hasPermission(session,'dwfxpg_sbyhgl_yhzz_bj')}"
								disabled="#{hiddenDangerTrackController.selected == null }"
								 oncomplete="openHiddenTrackDetail('#{hiddenDangerTrackController.selected.id}','#{hiddenDangerTrackController.changeStatus}')" >
							<p:ajax listener ="#{hiddenDangerTrackController.preEdit}" event="click" ></p:ajax>
							 <p:remoteCommand name="onDialogReturn"  update =":form:dataTb" actionListener="#{hiddenDangerTrackController.onDialogReturn}"/>				
							</p:commandButton>	 
							<p:commandButton value="删除" icon="ui-icon-trash"
								rendered="#{s:hasPermission(session,'dwfxpg_sbyhgl_yhzz_sc')}"
								actionListener="#{hiddenDangerTrackController.deleteTrack}"
								disabled="#{hiddenDangerTrackController.selected == null}"
								update="form:dataTb form:msgs headForm:toolbar">
								<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
							</p:commandButton>
							<!-- <p:commandButton value="详细" icon="ui-icon-document"  
								disabled="#{hiddenDangerTrackController.selected == null}"
								 oncomplete="openHiddenTrackDetail('#{hiddenDangerTrackController.selected.id}','#{hiddenDangerTrackController.changeStatus}')" >
						     <p:ajax listener ="#{hiddenDangerTrackController.changeStatus}" event="click" ></p:ajax>
						    </p:commandButton> -->
						</f:facet>
					</p:toolbar>
				</div>
			</h:form>
		</div>
		<div id="infoDiv" class="box box-solid with-border">
			<h:form id="form"  >
				<p:growl id="msgs" showDetail="true" />
				  <p:treeTable id="dataTb" widgetVar="dataTb" scrollable="true"  resizableColumn="true"   scrollWidth="1640" scrollHeight="650" 
									value="#{hiddenDangerTrackController.trackRoot}" selectionMode="single" 
									selection="#{hiddenDangerTrackController.selectedNode}" var="fun" ><!-- liveResize="true" style="width:8000px;"-->
									<p:ajax event="select"  update=":headForm:toolbar "
										listener="#{hiddenDangerTrackController.onTreeTableNodeSelect}" />
									<p:ajax event="unselect"  update=":headForm:toolbar"
										listener="#{hiddenDangerTrackController.onNodeUnSelect}" />
									<p:column headerText="计划名称"  style="width:130px;">
										<h:outputText value="#{fun.inspectionPlanName} " style="white-space:pre-wrap;" escape="false" />
									</p:column>
									<p:column headerText="检查子项"  style="width:100px;">
										<h:outputText value="#{fun.checkSubitem}"   />
									</p:column>
									<p:column headerText="对应表单规范号"   style="width:110px;">
										<a href="../standardlib/assessmentStandardLib.xhtml" style="color:red" ><h:outputText value="#{fun.specificationNumber} " /></a>
									</p:column>
									<p:column headerText="检查要素及要求"   style="width:160px;">
										<h:outputText value="#{fun.elementAndRequest}"  style="white-space:pre-wrap;" escape="false"   />
									</p:column>
									<p:column headerText="评分标准"  style="width:140px;">
										<h:outputText value="#{fun.scoreCriteria}" style="white-space:pre-wrap;" escape="false"   />
									</p:column>
									<p:column headerText="被检变电站"  style="width:100px;">
										<h:outputText value="#{fun.inspectedSubstation}"   />
									</p:column>
									<p:column headerText="电压等级(kV)"  style="width:100px;">
										<h:outputText  value="#{fun.voltageLevel}" />
									</p:column>
									
									<p:column headerText="问题设备"   style="width:140px;">
										<h:outputText value="#{fun.problemEquipment} " style="white-space:pre-wrap;" escape="false" />
									</p:column>
									<p:column headerText="隐患等级"   style="width:80px;">
										<h:outputText value="#{fun.hiddenDangerGrade}"   />
									</p:column>
									<p:column headerText="隐患描述"  style="width:160px;">
										<h:outputText value="#{fun.hiddenDangerDesc} " style="white-space:pre-wrap;" escape="false" />
									</p:column> 
									<p:column headerText="整改方案"  style="width:160px;">
										<h:outputText value="#{fun.rectificationPlan} " style="white-space:pre-wrap;" escape="false" />
									</p:column>
									<p:column headerText="扣分情况"  style="width:70px;">
										<h:outputText value="#{fun.scoreDeduction}"   />
									</p:column>
									<p:column headerText="是否完成"  style="width:80px;">
										<h:outputText value="#{fun.rectifyFinished}"   />
									</p:column>
									<p:column headerText="隐患来源"  style="width:100px;">
										<h:outputText value="#{fun.sourcesOfHiddenDanger}"   />
									</p:column>
									<p:column headerText="管辖专业"  style="width:100px;">
										<h:outputText value="#{fun.jurisdictionalSpecialty}"   />
									</p:column>
									<p:column headerText="问题归类"  style="width:100px;">
										<h:outputText value="#{fun.hiddenDangerProblemClass}"   />
									</p:column>
									<p:column headerText="原因归类" style="width:100px;">
										<h:outputText value="#{fun.hiddenDangerReasonClass}"   />
									</p:column>
									<p:column headerText="检查专家" style="width:100px;">
										<h:outputText value="#{fun.inspectionExpert}"   />
									</p:column>
									<p:column headerText="检查专家电话"   style="width:120px;">
										<h:outputText value="#{fun.inspectionExpertTel}"   />
									</p:column>
									<p:column headerText="迎检人员"   style="width:100px;">
										<h:outputText value="#{fun.checkInPerson}"   />
									</p:column>
									<p:column headerText="迎检人员电话"  style="width:120px;">
										<h:outputText value="#{fun.checkInPersonTel}"   />
									</p:column>
									<p:column headerText="整改负责人员"  style="width:100px;">
										<h:outputText value="#{fun.personOfRectify}"   />
									</p:column>
									<p:column headerText="整改负责人员电话"  style="width:120px;" >
										<h:outputText value="#{fun.personOfRectifyTel}"   />
									</p:column>
									<p:column headerText="专家派出分子公司"  style="width:120px;" >
										<h:outputText value="#{fun.expertOfCompany}"   />
									</p:column>
									<p:column headerText="被检分子公司"  style="width:100px;">
										<h:outputText value="#{fun.inspectedMoleculeCompany}"   />
									</p:column>
									<p:column headerText="被检单位"   style="width:100px;">
										<h:outputText value="#{fun.inspectedUnit}"   />
									</p:column>
									<p:column headerText="间隔名称"  style="width:120px;">
										<h:outputText value="#{fun.intervaName} " style="white-space:pre-wrap;" escape="false" />
									</p:column>
									<p:column headerText="月度整改进度"   style="width:100px;">
										<h:outputText value="#{fun.monthRectifyProgress}"   />
									</p:column>
									<p:column headerText="被检单位意见" style="width:100px;">
										<h:outputText value="#{fun.opinionsOfUint}"   />
									</p:column>
									<p:column headerText="申诉说明"   style="width:100px;">
										<h:outputText value="#{fun.stateOfUnit}"   />
									</p:column>
									<p:column headerText="备注"  style="width:100px;">
										<h:outputText value="#{fun.remark}"   />
									</p:column>
				</p:treeTable>
			</h:form>
		</div>
	</ui:define>
	<ui:define name="contentend">
		<script src="/resources/js/tables/singleScrollTable.js" />
		<script src="/ui/map/dialog/riskAlarmDialog/searchAlarmMsgDlg.js?version=1.0" />
		<script src="/resources/js/tables/singleScrollTreeTable.js"></script>
	</ui:define>
</ui:composition>